package com.xyhy.core.web.model.wrapper;

import jakarta.servlet.http.HttpServletResponse;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ResultCode implements IResultCode {
  SUCCESS(HttpServletResponse.SC_OK, "操作成功"), // 200

  BAD_REQUEST(HttpServletResponse.SC_BAD_REQUEST, "参数请求错误"), // 400
  UN_AUTHORIZED(HttpServletResponse.SC_UNAUTHORIZED, "未授权，请登陆"), // 401
  FORBIDDEN(HttpServletResponse.SC_FORBIDDEN, "抱歉，您没有访问权限"), // 403

  INTERNAL_SERVER_ERROR(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "服务器异常"), // 500
  USER_PASSWORD_ERROR(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "账号或密码错误!"), // 500
  USER_NOT_EXIST(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "用户不存在!"), // 500

  /* 系统相关 */
  AUTHENTICATE_ERROR(10000, "认证失败"), // 10000
  AUTHENTICATE_ERROR_PHONE_NEED(10010, "第一次登陆，需要手机号"), // 10010
  AUTHENTICATE_ERROR_NEED_REGISTER(10020, "需注册"), // 10020

  ;

  /**
   * code编码
   */
  final int code;
  /**
   * 中文信息描述
   */
  final String message;
}
